From 60d879b52bd5720e4b80710520e6bdbd700d8b4a Mon Sep 17 00:00:00 2001 From: Leo Koppelkamm Date: Wed, 27 Jul 2011 21:53:28 +0000 Subject: [PATCH] Recommit r93264 ( Remove semantically incorrect wrapper table from toc and replace it with an inline-blocked diff. Update some skin css, since we don't have the implicit table padding anymore and need to increase to padding to maintain the current look. ) with parser tests and release notes --- RELEASE-NOTES-1.19 | 1 + includes/Linker.php | 4 ++-- skins/common/shared.css | 12 +++++++++++- skins/modern/main.css | 7 +------ skins/monobook/main.css | 3 +-- skins/vector/screen.css | 3 +-- tests/parser/parserTests.txt | 36 ++++++++++++++++++------------------ 7 files changed, 35 insertions(+), 31 deletions(-) diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 183f89d9ba..1cf88060dc 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -28,6 +28,7 @@ production. $wgUploadMissingFileUrl is not set. The first was used for this until the second was introduced in 1.17. * (bug 25355) Parser generates edit section links for special pages +* (bug 13766) Change table of content syntax to be semantically correct === API changes in 1.19 === * (bug 19838) siprop=interwikimap can now use the interwiki cache. diff --git a/includes/Linker.php b/includes/Linker.php index f724ca6d6a..525a6fad5a 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -1456,10 +1456,10 @@ class Linker { static function tocList( $toc, $lang = false ) { $title = wfMsgExt( 'toc', array( 'language' => $lang, 'escape' ) ); return - '
' + '
' . '

' . $title . "

\n" . $toc - . "\n
\n"; + . "\n\n"; } /** diff --git a/skins/common/shared.css b/skins/common/shared.css index f01b4b4020..b0d0689a32 100644 --- a/skins/common/shared.css +++ b/skins/common/shared.css @@ -783,4 +783,14 @@ div.floatright, table.floatright, div.floatleft, table.floatleft { } /* bug 12205 */ -#mw-credits a { unicode-bidi: embed; } \ No newline at end of file +#mw-credits a { + unicode-bidi: embed; +} + +/* Standard toc */ +#toc { + display: inline-block; + /* IE6+7 workaround */ + zoom: 1; + display: inline !ie; +} \ No newline at end of file diff --git a/skins/modern/main.css b/skins/modern/main.css index d1fa902086..860de365ba 100644 --- a/skins/modern/main.css +++ b/skins/modern/main.css @@ -556,11 +556,6 @@ img.thumbborder { border: solid 1px #bbb; } -#toc tr, #toc td { - margin: 0; - padding: 0; -} - #toctitle { border-bottom: solid 1px #3c78b5; background-color: #ddd; @@ -587,7 +582,7 @@ img.thumbborder { list-style-type: none; list-style-image: none; margin: 0 1em; - padding-left: 0; + padding: 0; text-align: left; } diff --git a/skins/monobook/main.css b/skins/monobook/main.css index 75b57e3555..0fcb4780dd 100644 --- a/skins/monobook/main.css +++ b/skins/monobook/main.css @@ -348,8 +348,7 @@ table.small { .toc ul { list-style-type: none; list-style-image: none; - margin-left: 0; - padding-left: 0; + padding: 0 .4em; text-align: left; } #toc ul ul, diff --git a/skins/vector/screen.css b/skins/vector/screen.css index 8f611b76e9..ba604b42de 100644 --- a/skins/vector/screen.css +++ b/skins/vector/screen.css @@ -884,8 +884,7 @@ select { .toc ul { list-style-type: none; list-style-image: none; - margin-left: 0; - padding-left: 0; + padding: 0 .4em; text-align: left; } #toc ul ul, diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index ef5a663b7d..c4a0015a99 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -4560,7 +4560,7 @@ Section headings with TOC Some text ===Another headline=== !! result -

Contents

+

Contents

-
+

[edit] Headline 1

[edit] Subheadline 1

[edit] Skipping a level
@@ -4608,7 +4608,7 @@ Handling of sections up to level 6 and beyond ========= Level 9 Heading========= ========== Level 10 Heading========== !! result -

Contents

+

Contents

  • 1 Level 1 Heading
      @@ -4636,7 +4636,7 @@ Handling of sections up to level 6 and beyond
-
+

[edit] Level 1 Heading

[edit] Level 2 Heading

[edit] Level 3 Heading

@@ -4660,7 +4660,7 @@ TOC regression (bug 9764) == title 2 == === title 2.1 === !! result -

Contents

+

Contents

  • 1 title 1
      @@ -4678,7 +4678,7 @@ TOC regression (bug 9764)
-
+

[edit] title 1

[edit] title 1.1

[edit] title 1.1.1

@@ -4700,7 +4700,7 @@ wgMaxTocLevel=3 == title 2 == === title 2.1 === !! result -

Contents

+

Contents

  • 1 title 1
      @@ -4714,7 +4714,7 @@ wgMaxTocLevel=3
-
+

[edit] title 1

[edit] title 1.1

[edit] title 1.1.1

@@ -4735,7 +4735,7 @@ wgMaxTocLevel=3 ====Section 1.1.1.1==== ==Section 2== !! result -

Contents

+

Contents

+

[edit] Section 1

[edit] Section 1.1

[edit] Section 1.1.1

@@ -4827,7 +4827,7 @@ __TOC__ === title 1.1 === == title 2 == !! result -

Contents

+

Contents

+

[edit] title 1

[edit] title 1.1

[edit] title 2

@@ -4891,7 +4891,7 @@ section 5 !! result

The tooltips shall not show entities to the user (ie. be double escaped)

-

Contents

+

Contents

-
+

[edit] text > text

section 1

@@ -6119,11 +6119,11 @@ Fuzz testing: Parser14 http://__TOC__ !! result

[edit] onmouseover=

-http://

Contents

+http://

Contents

-
+ !! end @@ -7953,7 +7953,7 @@ Out-of-order TOC heading levels =====5===== ==2== !! result -

Contents

+

Contents

  • 1 2
      @@ -7968,7 +7968,7 @@ Out-of-order TOC heading levels
-
+

[edit] 2

[edit] 6

[edit] 3

-- 2.20.1